fix(deps): update dependency api-platform/core to v3.4.17 [security]#7168
Merged
renovate[bot] merged 1 commit intodevelfrom Apr 11, 2025
Merged
Conversation
Contributor
Author
Branch automerge failureThis PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.
|
e5ef1bc to
3641513
Compare
BacLuc
approved these changes
Apr 8, 2025
3641513 to
de90254
Compare
auto-merge was automatically disabled
April 11, 2025 19:33
Pull request was closed
830700d to
de90254
Compare
pmattmann
approved these changes
Apr 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.4.16->3.4.17GitHub Vulnerability Alerts
CVE-2025-31485
Original message:
I found an issue with security grants on on properties in the GraphQL ItemNormalizer:
If you use something like
#[ApiProperty(security: 'is_granted("PROPERTY_READ", [object, property])')]on a member of an entity, the grant gets cached and is only evaluated once, even if theobjectin question is a different one.There is the
ApiPlatform\GraphQl\Serializer\ItemNormalizer::isCacheKeySafe()method that seems to be intended to prevent this: https://github.com/api-platform/core/blob/88f5ac50d20d6510686a7552310cc567fcca45bf/src/GraphQl/Serializer/ItemNormalizer.php#L160-L164and in its usage on line 90 it does indeed not create a cache key, but the
parent::normalize()that is called afterwards still creates the cache key and causes the issue.Impact
It grants access to properties that it should not.
Workarounds
Override the ItemNormalizer.
Patched at: api-platform/core@7af65aa
CVE-2025-31481
Summary
Using the Relay special
nodetype you can bypass the configured security on an operation.Details
Here is an example of how to apply security configurations for the GraphQL operations:
#[ApiResource( security: "is_granted('ROLE_USER')", operations: [ /* ... */ ], graphQlOperations: [ new Query(security: "is_granted('ROLE_USER')"), //... ], )] class Book { /* ... */ }This indeed checks
is_granted('ROLE_USER')as expected for a GraphQL query like the following:query { book(id: "/books/1") { title } }But the security check can be bypassed by using the
nodefield (that is available by default) on the root query type like that:query { node(id: "/books/1") { ... on Book { title } } }This does not execute any security checks and can therefore be used to access any entity without restrictions by everyone that has access to the API.
Impact
Everyone using GraphQl with the
securityattribute. Not sure whereas this works with custom resolvers nor if this also applies on mutation.Patched at api-platform/core@60747cc
Release Notes
api-platform/core (api-platform/core)
v3.4.17Compare Source
Exceptional release as 3.4 is not maintained anymore, this resolves our recent security issues:
GHSA-cg3c-245w-728m
GHSA-428q-q3vv-3fq3
What's Changed
Full Changelog: api-platform/core@v3.4.16...v3.4.17
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.